const formatTime = (time = new Date().getTime()) => {
  const Y = new Date(time).getFullYear()
  const M = new Date(time).getMonth() + 1
  const D = new Date(time).getDate()
  const h = new Date(time).getHours()
  const m = new Date(time).getMinutes()
  const s = new Date(time).getSeconds()
  return `${Y}-${M < 10? '0'+M : M}-${D<10?'0'+D:D} ${h<10?'0'+h:h}:${m<10?'0'+m:m}:${s<10?'0'+s:s}`
}

export default formatTime